GH-5166 Adding user account state to be refreshed during Instance Launch #5284
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In the login function of LaunchController, added requestRefresh on the current m_accountToUse. This allows the accountState of accountToUse to be updated before running through what login is meant to depending on the accountState. This is to allow for the cases where a device might be back online after launching the Launcher. Putting this in the tryagain while loop also allows to check if a users account is expired during the login process.
Adds a force account refresh during the login process, updating the account state before the program performs an action depending on the account state.
This allows for users to start an instance with no internet connection, realise and update their internet connection and start an instance again with no issue.
Putting this in the tryagain while loop also allows to check if a users account is expired during the login process.
This also resolves issue GH-4356.
Tested as much as I could on Ubuntu Linux 22.04.3 LTS. No noticeable lag or crashes noticed with multiple launches rapidly in a row and was able to confirm that the account status does change in this case.